#include<iostream>
#include<algorithm>
using namespace std;

string a, b;
int main() {
	cin >> a >> b;
	int cnt6 = 0, cnt8 = 0;
	int lena = a.size();
	for (int i = 0; i < lena; i++) {
		if (a[i] == b[i])
			continue;
		if (a[i] == '6')
			cnt6++;
		else if (a[i] == '8')
			cnt8++;
	}
	cout << abs(cnt6 - cnt8) + min(cnt6, cnt8);
	return 0;
}
